# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-with-editor
pkgver=3.3.2
pkgrel=0
_pkgreal=with-editor
pkgdesc="Use Emacsclient as EDITOR of child processes"
url="https://github.com/magit/with-editor"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	cmd:emacs
	emacs-compat
	"
makedepends="emacs-nox"
source="https://github.com/magit/with-editor/archive/v$pkgver/emacs-with-editor-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver/lisp"
options="!check" # no tests provided

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
9ee8f36da6e1735aedf9fb0dcf6480de649e3e2daebedd5fc1edf8a9f528046c269cc0bbe182d4cf33180ab11c4af3a794c49cfd2aaff9ddbddcd51b9c1fec21  emacs-with-editor-3.3.2.tar.gz
"
